<script type="text/javascript" src="/Public/js/jquery.form.min.js"></script>
<script language="javascript" type="text/javascript" src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>
<style>
ul,li{ margin: 0; padding: 0; list-style: none;}
.delspan{display: inline-block;vertical-align: middle;padding:0 5px;margin: 0 2px;background:#3b9fe1;color: #fff;line-height: 1.8;cursor: pointer;}
.textarea-m{width:480px;height:100px;padding:8px;box-sizing:border-box;}
.textarea-s{width:260px;height:60px;padding:8px;box-sizing:border-box;}
.textarea-t{width:180px;height:60px;padding:8px;box-sizing:border-box;}
.infolist2{ margin-top: 10px; width: 1000px;}
.infolist2 li{float: left;width: 420px;margin-bottom: 8px;margin-right: 15px;}
.infolist2 .li-left{display: block;position: relative;float: left;width: 80px;height: 60px;margin-right: 10px;padding: 0px;text-align: center;border: 1px #dcdcdc solid;box-sizing:border-box;}
.infolist2 .li-right{float: left;box-sizing:border-box;}
.infolist2 .li-left .txtspan2{position: absolute;top: 50%;left: 50%;width: 100%;display:block;text-align:center;line-height:1.2;font-size: 12px;padding: 0px 8px;transform: translate(-50%, -50%);-webkit-transform: translate(-50%, -50%);box-sizing:border-box;}
.input_title{color: #000;border: 0px;background-color: #FFF;padding: 20px 16px;}
.del-info-title{display: block;cursor: pointer;}
textarea{resize: none;}
</style>
<div class="form">
  <form method='post' id="form_do"  action="{:U(MODULE_NAME.'/Product/visaedit',array('id'=>$id))}">
    <dl>
      <dt>签证国家名称：</dt>
      <dd>
        {$countryHtml}
      </dd>
    </dl>
    <dl>
      <dt>签证类型名称：</dt>
      <dd>
        <input type="text" name="title" class="input-s" maxlength="30" value="{$visaProduct.name}" /> <input type="checkbox" name="schengenCheck" value="1" <if condition="$visaProduct['schengenCheck'] eq '1' ">checked</if> onChange="schengenCheckClick(this)" >申根签证
      </dd>
    </dl>
    <dl>
      <dt>关联国家：</dt>
      <dd>
        <foreach name="countryArr" item="countryArr">
        <span class="delspan">
          <a href="javascript:;" style="color: #FFF;">{$countryArr.name}</a>
          <input type="hidden" name="countryID[]" value="{$countryArr.id}">
          <a href="javascript:;" onClick="delCountry(this)" style="color: #FFF;">x</a>
        </span>
        </foreach>
        <a href="javascript:;" onclick="addCountry()" id="visaCoutry">+新增关联国家</a> <small class="red">(申根签证可新增）</small>
      </dd>
    </dl>
    <dl>
      <dt>签证有效期：</dt>
      <dd>
        <input type="text" class="input-s" name="validDate" value="{$visaProduct.validDate}"/>
        <input type="radio" name="validDateType" value="D" <if condition="$visaProduct['validDateType'] eq 'D' ">checked</if> >天&nbsp;&nbsp;
        <input type="radio" name="validDateType" value="M" <if condition="$visaProduct['validDateType'] eq 'M' ">checked</if> >月&nbsp;&nbsp;
        <input type="radio" name="validDateType" value="Y" <if condition="$visaProduct['validDateType'] eq 'Y' ">checked</if> >年&nbsp;&nbsp;
        <input type="radio" name="validDateType" value="0" <if condition="$visaProduct['validDateType'] eq '0' ">checked</if> >使馆批
      </dd>
    </dl>
    <dl>
      <dt>最长停留时间：</dt>
      <dd>
        <input  type="text" class="input-s" name="stopDate" value="{$visaProduct.stopDate}"/>
        <input type="radio" name="stopDateType" value="D" <if condition="$visaProduct['stopDateType'] eq 'D' ">checked</if> >天&nbsp;&nbsp;
        <input type="radio" name="stopDateType" value="M" <if condition="$visaProduct['stopDateType'] eq 'M' ">checked</if> >月&nbsp;&nbsp;
        <input type="radio" name="stopDateType" value="Y" <if condition="$visaProduct['stopDateType'] eq 'Y' ">checked</if> >年&nbsp;&nbsp;
        <input type="radio" name="stopDateType" value="0" <if condition="$visaProduct['stopDateType'] eq '0' ">checked</if> >使馆批
      </dd>
    </dl>
    <dl>
      <dt>预计工作日：</dt>
      <dd>
        <input  type="text" class="input-s" name="workDay" value="{$visaProduct.workDay}"/>天
      </dd>
    </dl>
    <dl>
      <dt>可入境次数：</dt>
      <dd>
        <input  type="text" class="input-s" name="entryNums" value="{$visaProduct.entryNums}"/>次
        <input type="checkbox"  name="entryNums" value="0" <if condition="$visaProduct['entryNums'] eq '0' ">checked</if> >使馆批
      </dd>
    </dl>
    <dl>
      <dt>是否需要面试：</dt>
      <dd>
        <input type="radio" name="interviewCheck" value="1" <if condition="$visaProduct['interviewCheck'] eq '1' ">checked</if> >需要&nbsp;&nbsp;
        <input type="radio" name="interviewCheck" value="-1" <if condition="$visaProduct['interviewCheck'] eq '-1' ">checked</if> >不需要&nbsp;&nbsp;
        <input type="radio" name="interviewCheck" value="0" <if condition="$visaProduct['interviewCheck'] eq '0' ">checked</if> >使馆定
      </dd>
    </dl>
    <dl>
      <dt>成本价格：</dt>
      <dd>
        <input  type="text" class="input-s" name="costPrice" value="{$visaProduct.costPrice}"/>元
      </dd>
    </dl>
    <dl>
      <dt>销售价格：</dt>
      <dd>
        <input  type="text" class="input-s" name="sellPrice" value="{$visaProduct.sellPrice}"/>元
      </dd>
    </dl>
    <dl>
      <dt>领区范围：</dt>
      <dd>
        <foreach name="provinceArr" item="provinceArr">
        <span class="delspan">
          <a href="javascript:;" style="color: #FFF;">{$provinceArr.province_name}</a>
          <input type="hidden" name="provinceID[]" value="{$provinceArr.province_id}">
          <a href="javascript:;" onClick="delCountry(this)" style="color: #FFF;">x</a>
        </span>
        </foreach>
        <a href="javascript:;" onclick="addDistrict()" id="visaProvince">+新增领区范围</a>
      </dd>
    </dl>

    <dl>
      <dt>所需资料：</dt>
      <dd>
        <ul class="infolist2">
          <if condition="$needDataArr" >
          
          <foreach name="needDataArr" item="needData">
          <li>
            <div class="li-left">
              <span class="txtspan2">{$needData.title}</span>
              <input type="hidden" name="needData[]" value="{$needData.title}" />
              <input type="hidden" name="needDataID[]" value="{$needData.id}" />
              <span class="del-info-title" onclick="delInfTitle(this,'{$needData.id}')">X</span>
            </div>

            <if condition="$needData['uploadPlugs'] eq 'N' " >

            <div class="li-right"><textarea class="textarea-s" name="content[]">{$needData.content}</textarea></div>
            <input type="hidden" name="uploadPlugs[]" value="N">

            <else />

            <div class="li-right"><textarea class="textarea-t" name="content[]" >{$needData.content}</textarea></div>
            <div class="li-right" style="margin: 6px;">
              <p style="margin: 0;"><if condition="$needData['uploadPlugs']" ><a href="http://www.tripvip.cn{$needData.uploadPlugs}">查看附件</a><else />暂无附件</if></p>
              <input type="file" name="filedata" value="上传附件" class="uploadPlugs" onChange="uploadPlugs(this)" style="width: 72px; height: 21px;">
              <input type="hidden" name="uploadPlugs[]" value="{$needData.uploadPlugs}">
            </div>
            </if>
          </li>

          </foreach>

          <else />

            <li>
              <div class="li-left">
                <span class="txtspan2">护照</span>
                <input type="hidden" name="needData[]" value="护照" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">结婚证明</span>
                <input type="hidden" name="needData[]" value="结婚证明" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">相片</span>
                <input type="hidden" name="needData[]" value="相片" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">签名表格</span>
                <input type="hidden" name="needData[]" value="签名表格" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">身份证</span>
                <input type="hidden" name="needData[]" value="身份证" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">单位证明信</span>
                <input type="hidden" name="needData[]" value="单位证明信" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">活期资金证明</span>
                <input type="hidden" name="needData[]" value="活期资金证明" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">单位资质证明</span>
                <input type="hidden" name="needData[]" value="单位资质证明" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">辅助资产证明</span>
                <input type="hidden" name="needData[]" value="辅助资产证明" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">定期资金证明</span>
                <input type="hidden" name="needData[]" value="定期资金证明" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">机票预订单</span>
                <input type="hidden" name="needData[]" value="机票预订单" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">行程安排</span>
                <input type="hidden" name="needData[]" value="行程安排" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">国际医疗保险</span>
                <input type="hidden" name="needData[]" value="国际医疗保险" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">住宿安排</span>
                <input type="hidden" name="needData[]" value="住宿安排" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">签证申请表</span>
                <input type="hidden" name="needData[]" value="签证申请表" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-t" name="content[]" ></textarea></div>
              <div class="li-right" style="margin: 6px;">
                <p style="margin: 0;">暂无附件</p>
                <input type="file" name="filedata" value="上传附件" class="uploadPlugs" onChange="uploadPlugs(this)" style="width: 72px; height: 21px;">
                <input type="hidden" name="uploadPlugs[]" value="">
              </div>
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">疫苗注射证明</span>
                <input type="hidden" name="needData[]" value="疫苗注射证明" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">个人资料表格</span>
                <input type="hidden" name="needData[]" value="个人资料表格" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-t" name="content[]" ></textarea></div>
              <div class="li-right" style="margin: 6px;">
                <p style="margin: 0;">暂无附件</p>
                <input type="file" name="filedata" value="上传附件" class="uploadPlugs" onChange="uploadPlugs(this)" style="width: 72px; height: 21px;">
                <input type="hidden" name="uploadPlugs[]" value="">
              </div>
            </li>
            <li>
              <div class="li-left">
                <span class="txtspan2">出资证明</span>
                <input type="hidden" name="needData[]" value="出资证明" />
                <span class="del-info-title" onclick="delInfTitle(this)">X</span>
              </div>
              <div class="li-right"><textarea class="textarea-s" name="content[]" ></textarea></div>
              <input type="hidden" name="uploadPlugs[]" value="N">
            </li>

          </if>

          <li>
            <div class="li-left" onclick="addNeedData(this)" style="cursor: pointer;"><span class="txtspan2"><font style="font-size:36px;">+</font></span></div>
            <div class="clear"></div>
          </li>
          <div class="clear"></div>
        </ul>
      </dd>
    </dl>

    <dl>
      <dt>签证须知：</dt>
      <dd>
        <textarea class="textarea-m" name="notice">{$visaProduct.notice}</textarea>
      </dd>
    </dl>
    <dl>
      <dt>备注：</dt>
      <dd>
        <textarea class="textarea-m" name="remark">{$visaProduct.remark}</textarea>
      </dd>
    </dl>

    <div class="form_b" style="width: 300px; margin-left: 110px;">
      <input type="button" class="button-green" onclick="submitDo()" value="保 存">
      &nbsp;
      <input type="button" onclick="goUrl('{:U(MODULE_NAME.'/Product/visalist')}')" class="button-return" value="返回产品列表">
    </div>
  </form>
</div>
<script type="text/javascript">

$(function() {

  wrapForm('uploadPlugs','Product');

});
/**
 * [delInfTitle description]
 * @param  {[type]} obj [description]
 * @return {[type]}     [description]
 */
function delInfTitle (obj,id)
{ 
  if(!id)id = '0';
  if(id == false)
  {
    $(obj).parent().parent().remove();
    return false;
  }

  $.ajax({
    url: '{:U(MODULE_NAME."/Product/delNeedDataAjax")}',
    type: 'post',
    dataType: 'json',
    data: {'id': id},
    success:function  (data) {
      
      if(data.valid == true)
      { 
        layer.msg(data.state, {icon: 1});
        $(obj).parent().parent().remove();
      }
      else
      {
        layer.msg(data.state, {icon: 2});
      }
    }
  })
}
/**
 * [schengenCheckClick description]
 * @return {[type]} [description]
 */
function schengenCheckClick(obj) 
{ 
  var checked = $(obj).is(':checked');
  if(checked == false)
  {
    $('#visaCoutry').prevAll('.delspan').remove();
  }
}
/**
 * [wrapForm description]
 * @param  {[type]} class [description]
 * @param  {[type]} type  [description]
 * @return {[type]}       [description]
 */
function wrapForm(className,type) 
{
  $("."+className).wrap("<form class='uploadImg' action='/Home/Public/uploadPic/fileType/Excel/type/"+type+".html' method='post' enctype='multipart/form-data'></form>");
}

/**
 * [uploadPlugs description]
 * @param  {[type]} obj [description]
 * @return {[type]}     [description]
 */
function uploadPlugs(obj) 
{
  if($(obj).val() == "") return;

    $(obj).parent().ajaxSubmit({
        dataType:  'json',
        beforeSend: function() {
          $(obj).parent().parent().find('p').empty();
          $(obj).parent().parent().find('p').html("正在上传中...");
        },
        success: function(data) {

          if(data.state == 'SUCCESS')
          {
              $(obj).parent().parent().find('p').html("上传成功...");
              $(obj).parent().parent().find('input[name="uploadPlugs[]"]').remove();
              $(obj).parent().parent().append('<input type="hidden" name="uploadPlugs[]" value="'+data.url+'">');
          }
          else
          {
              $(obj).parent().parent().find('p').html(data.msg);
          }
      },
      error:function(xhr){
        $(obj).parent().parent().find('p').html('上传失败!');
        $(obj).parent().parent().find('p').html(xhr);
      }
    });
}
/**
 * [addCountry description]
 * 国家添加
 */
function  addCountry()
{
  var html = '';
      html+='<div class="">';
        html+='<dl>';
          html+='<dt style="float: left; margin-left: 10px;">签证国家：</dt>';
          html+='<dd>';
            html+='<div class="selectDestinationNums" style="padding: 4px;">';
                html+='<div class="selectDestination" style="float: left;">';
                  html+='{$destinationHtml}';
                  html+='<select name="country" style="margin-left: 5px;">';
                    html+='<option value="0">请选择国家</option>';
                  html+='</select>';
                html+='</div>';
                html+='<div class="clear"></div>';
            html+='</div>';
          html+='</dd>';
        html+='</dl>';
      html+='</div>';
  //页面层-自定义
  var Div = layer.open({
      type: 1,
      title: '添加/编辑国家',
      area: ['300px', '150px'],
      shift: 0, //从左动画弹出
      content: html,
      btn:['确定','取消'],
      yes: function(index){
        var contryNums    = $('#visaCoutry').prevAll('.delspan').length;
        var schengenCheck = $('input[name="schengenCheck"]').is(':checked');
        var countryID     = $('select[name="country"]').val();
        var countryName   = $('select[name="country"]').find("option:selected").text();
        if(contryNums == '0')
        {
          if(countryID != false)
          {
            addCountryHtml(countryID,countryName);
            layer.close(Div);
          }
        }
        else if(contryNums > 0 && schengenCheck == true)
        {
          addCountryHtml(countryID,countryName);
          layer.close(Div);
        }
      },
      cancel: function(){
        layer.close(Div);
      }
  });
}
/**
 * [addCountryHtml description]
 *
 */
function addCountryHtml(countryID,countryName)
{
  html = '';
  html += '<span class="delspan">';
    html += '<a href="javascript:;" style="color: #FFF;">'+countryName+'</a>';
    html += '<input type="hidden" name="countryID[]" value="'+countryID+'">';
    html += '<a href="javascript:;" onClick="delCountry(this)" style="color: #FFF;">x</a>';
  html += '</span>';
  $('#visaCoutry').before(html);
}
/**
 * [delCountry description]
 * @param  {[type]} obj [description]
 * @return {[type]}     [description]
 */
function delCountry(obj)
{
    $(obj).parent().remove();
}

/**
 * [destinationSelect description]
 * @return {[type]} [description]
 */
function destinationSelect(obj)
{
  var destinationID = $(obj).val();
  if(destinationID == '0')
  {
    $(obj).nextAll('select').find('option').not('option[value="0"]').remove();
    return;
  }
  $.ajax({
    url: '{:U(MODULE_NAME.'/Product/destinationDataAjax')}',
    type: 'POST',
    dataType: 'json',
    data: {'destinationID': destinationID},
    success:function  (data) {

      $(obj).nextAll('select').find('option').not('option[value="0"]').remove();
      $(obj).next().append(data.destinationChildHtml);

    }
  })
}
/**
 * [addDistrict description]
 * 邻域范围添加
 */
function addDistrict()
{
  var html = '';
      html+='<div class="">';
        html+='<dl>';
          html+='<dt style="float: left; margin-left: 10px;">邻域范围/省：</dt>';
          html+='<dd>';
            html+='<div class="selectDestinationNums" style="padding: 4px;">';
                html+='<div class="selectDestination" style="float: left;">';
                  html+='{$provinceHtml}';
                html+='</div>';
                html+='<div class="clear"></div>';
            html+='</div>';
          html+='</dd>';
        html+='</dl>';
      html+='</div>';
  //页面层-自定义
  var Div = layer.open({
      type: 1,
      title: '添加/编辑邻域范围',
      area: ['300px', '150px'],
      shift: 0, //从左动画弹出
      content: html,
      btn:['确定','取消'],
      yes: function(index){

        var provinceID     = $('select[name="provinceID"]').val();
        var provinceName   = $('select[name="provinceID"]').find("option:selected").text();

          if(provinceID != false)
          {
            addDistrictHtml(provinceID,provinceName);
            layer.close(Div);
          }
      },
      cancel: function(){
        layer.close(Div);
      }
  });
}
/**
 * [addCountryHtml description]
 *
 */
function addDistrictHtml(provinceID,provinceName)
{
  html = '';
  html += '<span class="delspan">';
    html += '<a href="javascript:;" style="color: #FFF;">'+provinceName+'</a>';
    html += '<input type="hidden" name="provinceID[]" value="'+provinceID+'">';
    html += '<a href="javascript:;" onClick="delCountry(this)" style="color: #FFF;">x</a>';
  html += '</span>';
  $('#visaProvince').before(html);
}

/**
 * [addNeedData description]
 * @param {[type]} obj [description]
 */
function addNeedData(obj)
{
  var html = '';
      html+='<div class="">';
        html+='<dl>';
          html+='<dt style="float: left; margin-left: 10px;">标题：</dt>';
          html+='<dd><input type="text" name="needDatatitle"><input type="checkbox" name="uploadPlugs" ><span style="font-size: 12px;">是否上传附件</span></dd>';
        html+='</dl>';
      html+='</div>';

  //页面层-自定义
  var Div = layer.open({
      type: 1,
      title: '添加/编辑邻域范围',
      area: ['320px', '150px'],
      shift: 0, //从左动画弹出
      content: html,
      btn:['确定','取消'],
      yes: function(index){

        var title     = $('input[name="needDatatitle"]').val();
        var checked   = $('input[name="uploadPlugs"]').is(':checked');

          if(title != false)
          {
            addNeedDataHtml(obj,title,checked);
            layer.close(Div);
          }
      },
      cancel: function(){
        layer.close(Div);
      }
  });
}

/**
 * [addNeedDataHtml description]
 */
function addNeedDataHtml(obj,title,checked)
{
  html = '';
  html += '<li>';
    html += '<div class="li-left">';
      html += '<span class="txtspan2">'+title+'</span>';
      html += '<input type="hidden" name="needData[]" value="'+title+'" />';
    html += '</div>';
    if(checked == true)
    { 
      html += '<div class="li-right"><textarea class="textarea-t" name="content[]" maxlength="300"></textarea></div>';
      html += '<div class="li-right" style="margin: 6px;">';
        html += '<p style="margin: 0;">暂无附件</p>';
        html += '<input type="file" name="filedata" value="上传附件" class="uploadPlugs" onChange="uploadPlugs(this)" style="width: 72px; height: 21px;">';
        html += '<input type="hidden" name="uploadPlugs[]" value="">';
      html += '</div>';
    }
    else
    {
      html += '<div class="li-right"><textarea class="textarea-s" name="content[]" maxlength="300"></textarea></div>';
      html += '<input type="hidden" name="uploadPlugs[]" value="N">';
    }
  html += '</li>';
  $(obj).parent().before(html);
  wrapForm('uploadPlugs','Product');
}


/**
 * [submitDo description]
 * @return {[type]} [description]
 */
function submitDo()
{
  if($('input[name="title"]').length > 0)
  {
    if($('input[name="title"]').val().length > 0)
    {
      $('input[name="title"]').css('border','1px green solid');
      $('#form_do').submit();
    }
    else
    {
      $('input[name="title"]').css('border','1px red solid');
    }
  }
  else
  {
    $('#form_do').submit();
  }

}


</script>